from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import *
from PyQt5 import QtWidgets, QtCore


class DateDialog(QDialog):
    def __init__(self,parent=None):
        super(DateDialog,self).__init__(parent)
        self.setWindowTitle("打赏作者")
        self.resize(500, 400)

        self.pushButton = QtWidgets.QPushButton(self)
        self.pushButton.setGeometry(QtCore.QRect(50, 50, 141, 28))
        # self.pushButton.clicked.connect(self.alipay)#按键显示图片失败
        self.pushButton.setObjectName("pushButton")
        self.pushButton_2 = QtWidgets.QPushButton(self)
        self.pushButton_2.setGeometry(QtCore.QRect(290, 50, 151, 28))
        self.pushButton_2.setObjectName("pushButton_2")
        self.pushButton_3 = QtWidgets.QPushButton(self)
        self.pushButton_3.setGeometry(QtCore.QRect(140, 320, 201, 28))
        self.pushButton_3.setObjectName("pushButton_3")
        self.pushButton_3.clicked.connect(self.close)
        _translate = QtCore.QCoreApplication.translate
        self.pushButton.setText(_translate("dialog1", "支付宝打赏—*宇浩"))
        self.pushButton_2.setText(_translate("dialog1", "微信打赏-张*浩"))
        self.pushButton_3.setText(_translate("dialog1", "爱您！点击这里退出哦"))

        self.setWindowFlag(QtCore.Qt.FramelessWindowHint)  # 隐藏边框
        self.alipay()
        self.tencentpay()

    def alipay(self):
        filename = QPixmap('image/alipay.jpg')
        lb1 = QLabel(self)
        lb1.setGeometry(50, 90, 144, 224)
        lb1.setPixmap(filename)
        lb1.setScaledContents(True)
    def tencentpay(self):
        filename2 = QPixmap('image/tencentpay.png')
        lb2 = QLabel(self)
        lb2.setGeometry(290, 90, 144, 224)
        lb2.setPixmap(filename2)
        lb2.setScaledContents(True)